<?php 

header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Headers: *");

if ($_POST['table'] == "") {
	echo "Post parameter <table_name> <[array_of_record_id]>";
	return;
}

if ($_POST['id'] == "") {
	echo "Post parameter <table_name> <[array_of_record_id]>";
	return;
}

include '../DB/dbConnection.php';
$idArry = $_POST['id'];

for($x = 0; $x < $idArry; $x++) {
    echo $idArry[$x];

	$sql = "DELETE * FROM ".$_POST['table']." WHERE id=".$idArry[$x];
	
	$res = mysqli_query($conn, $sql);
}	
	


$conn->close();
?>